<!--tvm票款差异协查-->
<template>
  <div class="TvmTicketCYXC HuikuiInfo el-card is-always-shadow el-card__body">
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      @close="closed"
      width="80%">
      <div style="line-height: 40px;background-color: #fcf7f7;padding-left: 15px">
        <span>线路：</span><span>{{getLineName(formData.lineCode)}}</span>
        <span style="margin-left: 20px">站点：</span><span>{{getStationName(formData.lineCode,formData.stationCode)}}</span>
        <span style="margin-left: 20px">TVM编号：</span><span>{{formData.tvmCode}}</span>
        <span style="margin-left: 20px"> 收入日期：</span><span>{{formData.recordTime}}</span>
      </div>
      <avue-form :option="option" v-model="formData" @submit="handleSubmit" class="huikuiForm">

        <template slot-scope="{scope}" slot="dynamic">
          <avue-crud
            ref="TvmTicketCYXC"
            :option="listOption1"
            :data="formData.list1">
          </avue-crud>
        </template>
        <template slot-scope="{scope}" slot="dynamic2">
          <avue-crud
            ref="TvmTicketCYXC"
            :option="listOption2"
            :data="formData.list2">
          </avue-crud>
        </template>
        <template slot-scope="scope" slot="menuForm">
          <el-button type="primary" @click="closed">返回</el-button>
        </template>
      </avue-form>
    </el-dialog>
  </div>
</template>


<script>
  import {getForm, postForm} from '@/api/gen/gen'
  import ExportJsonExcel from "js-export-excel";
  import moment from 'moment';
  import {
    clearSelect,
    electromeReasons,
    getQianxiangType,
    qianxiangType,
    selectReasons,
    fenExYuangettoFixed,
    getLineName,
    getStationName
  } from "../../../../api/subwayRat/commonCheck";
  import {
    get_xw_pk_CarData,
    get_xw_pk_JieZhangDanjuData, xw_pk_cy_option_cols1,
    xw_pk_cy_option_cols2
  } from "../../../../api/stationTiecketManager/xianWngCJXXQR/tvmPiaoKuanCY/HuikuiInfo";

  export default {
    components:{
    },
    data() {
      return {
        dialogVisible:false,
        //1预览，2编辑，
        showType:1,
        listOption1:xw_pk_cy_option_cols1,
        listOption2:xw_pk_cy_option_cols2,
        formData:{
          list1: [],
          list2: [],
        },
        option:{}
    }
    },
    created() {

    },
    methods: {
      getLineName,
      getStationName,
      fenExYuangettoFixed,
      getQianxiangType,
      handleSubmit(form,done){

      },
      async recallShow(row,parantThis){
        Object.assign(this.formData,row);
        this.formData={}
        let th=this;
        let param={settleTime:moment(row.settleTime).format('YYYY-MM-DD'),tvmOrder:row.tvmOrder,lineCode:row.lineCode,stationCode:row.stationCode};

       let res= await get_xw_pk_CarData(param);
       let will= res.data.data;
       th.formData.list1=will;

        let res2= await get_xw_pk_JieZhangDanjuData(param);
        let will2=res2.data.data;
        th.formData.list2=will2;
        this.getOption();
      },
      formatAmount(row,isYuan){
        if(isYuan){
          row.tvmUnloadMoney=fenExYuangettoFixed(row,'tvmUnloadMoney');
          row.replyDsiplayMoney=fenExYuangettoFixed(row,'replyDsiplayMoney');
          row.diffUnloadDisplayMoney=fenExYuangettoFixed(row,'diffUnloadDisplayMoney');
          row.actualMoney=fenExYuangettoFixed(row,'actualMoney');
          row.replyLoadUnloadMoney=fenExYuangettoFixed(row,'replyLoadUnloadMoney');
          row.diffLoadUnloadMoney=fenExYuangettoFixed(row,'diffLoadUnloadMoney');
          row.supplementMoney=fenExYuangettoFixed(row,'supplementMoney');
          row.replySupplementMoney=fenExYuangettoFixed(row,'replySupplementMoney');
          row.diffSupplementMoney=fenExYuangettoFixed(row,'diffSupplementMoney');
        }else{
          row.tvmUnloadMoney=Number(row.tvmUnloadMoney)*100;
          row.replyDsiplayMoney=Number(row.replyDsiplayMoney)*100;
          row.diffUnloadDisplayMoney=Number(row.diffUnloadDisplayMoney)*100;
          row.actualMoney=Number(row.actualMoney)*100;
          row.replyLoadUnloadMoney=Number(row.replyLoadUnloadMoney)*100;
          row.diffLoadUnloadMoney=Number(row.diffLoadUnloadMoney)*100;
          row.supplementMoney=Number(row.supplementMoney)*100;
          row.replySupplementMoney=Number(row.replySupplementMoney)*100;
          row.diffSupplementMoney=Number(row.diffSupplementMoney)*100;
        }
      },
      closed(){
        this.dialogVisible=false;
        // this.$parent.isShowDia=false;
      },
      getOption(){
        this.option={
          submitBtn:false,
          emptyBtn:false,
          // submitText:'确认',
          // emptyText:'返回',
          group:[
            {
              icon:'',
              sortable:true,
              label: '车站数据',
              // collapse:false,
              prop: 'group1',
              indexLabel:"#",
              column: [{
                label: '',
                prop: 'dynamic',
                span:24,
                formslot:true
              }
              ]
            },
            {
              icon:'',
              label: '结帐单据数据',
              // collapse:false,
              prop: 'group2',
              column: [{
                label: '',
                prop: 'dynamic2',
                labelWidth:200,
                span:24,
                formslot:true
              }]
            }
          ]
        };
        this.isReload=false;
        this.$nextTick(()=>{
          this.isReload=true;
        })
      }
    },
    mounted() {

    }
  }
</script>
<style lang="scss">
  .TvmTicketCYXC.HuikuiInfo{



  }
</style>
